cmake_minimum_required (VERSION 2.8)

project (sdl-layer)

include(FindSDL)

# Add the SDL include dir
include_directories(${SDL_INCLUDE_DIR} ${PROJECT_SOURCE_DIR})

link_libraries (
  ${SDL_LIBRARY}
)

# Current version
set (SDLAYER_VERSION_MAJOR 0)
set (SDLAYER_VERSION_MINOR 22)

# CMake settings are set in the following header file.
configure_file (
  "${PROJECT_SOURCE_DIR}/cmake_config.h.in"
  "${PROJECT_SOURCE_DIR}/cmake_config.h"
  )

# Collects all the library sources
file(GLOB SRCS *.c)

# Build both as static and dynamic
set (SDLAYER_LIBRARY_SHARED "SDL_Layer_shared")
set (SDLAYER_LIBRARY_STATIC "SDL_Layer_static")

add_library(${SDLAYER_LIBRARY_SHARED} SHARED ${SRCS})
add_library(${SDLAYER_LIBRARY_STATIC} STATIC ${SRCS})

# Compile the demos (if requested)
add_subdirectory(demos)

